# Contributor: Zach DeCook <zachdecook@librem.one>
maintainer="Krystian Chachuła <krystian@krystianch.com>"
pkgname=rpicam-apps
pkgver=1.5.0
pkgrel=1
pkgdesc="Suite of libcamera-based applications to drive the Raspberry Pi cameras"
url="https://github.com/raspberrypi/rpicam-apps"
arch="aarch64 armhf armv7" # libcamera by default only includes rpi/vc4 pipeline on these archs
license="BSD-2-Clause"
depends="libcamera-raspberrypi"
makedepends="
	boost-dev
	ffmpeg-dev
	libcamera-dev
	libdrm-dev
	libexif-dev
	libjpeg-turbo-dev
	libpng-dev
	meson
	musl-dev
	tiff-dev
"
subpackages="$pkgname-doc"
source="https://github.com/raspberrypi/rpicam-apps/archive/v$pkgver/rpicam-apps-v$pkgver.tar.gz"

build() {
	abuild-meson \
		-Denable_libav=enabled \
		-Denable_drm=enabled \
		-Denable_egl=disabled \
		-Denable_qt=disabled \
		-Denable_opencv=disabled \
		-Denable_tflite=disabled \
		-Dneon_flags=auto \
		-Denable_hailo=disabled \
		-Ddownload_hailo_models=false \
		build .
	meson compile -C build
}

check() {
	meson test --no-rebuild --print-errorlogs -C build
}

package() {
	DESTDIR="$pkgdir" meson install --no-rebuild -C build
	install -Dm644 license.txt "$pkgdir"/usr/share/licenses/$pkgname/license.txt
}

sha512sums="
4d359cb6868c0bf8c1d4e86589bc2ffff2f506755f6495848b8a39269ccad95a75952380681c9c6cb38ea1a6be2381a402076f286baf8e10fb740682f8493cda  rpicam-apps-v1.5.0.tar.gz
"
